package org.theSeed.fileContract.paramEncoder.impl;

import cn.hutool.core.codec.Base64Decoder;
import cn.hutool.core.codec.Base64Encoder;
import org.theSeed.fileContract.paramEncoder.SeedFileParamEncoder;

import java.nio.charset.StandardCharsets;

public class ParamEncoderBase64 implements SeedFileParamEncoder {
    @Override
    public String deCodeData(String dataStr) {
        return Base64Decoder.decodeStr(dataStr);
    }

    @Override
    public String enCodeData(String data) {
        return Base64Encoder.encode(data.getBytes(StandardCharsets.UTF_8));
    }
}
